package level.editor.tool;

import level.editor.command.Command;
import level.editor.mediator.Mediator;
import level.editor.mediator.Module;
import level.editor.window.HasView;
import level.editor.window.Window;

public class ToolModule extends Module implements HasView
{
	private ToolView view;

	public ToolModule(Mediator mediator)
	{
		super(mediator, "ToolModule");
		view = null;
	}

	@Override
	public void establishView(Window window)
	{
		ToolView view = new ToolView();
		this.view = view;
		view.registerModule(this);
		view.init(window);
	}
	
	@Override
	public void pushDownCommand(Command command)
	{
		if (view != null && command != null)
		{
			view.pushDownCommand(command);
		}
	}

}
